using Yoozoo.Managers.NetworkV2.Client;
using Yoozoo.Managers.NetworkV2.Core;
using Yoozoo.Managers.NetworkV2.DataStruct;
using Yoozoo.Managers.NetworkV2.Helpers;
using System;
using UnityEngine;

namespace Yoozoo.Framework.Network.Helpers
{
    public class GTAMainChannelHeartBeatHelper : DefaultChannelHeartBeatHelper
    {
        public override bool ResetByAnyReceive
        {
            get { return true; }
        }
        
        
        public override void Init(NetChannel channel){
            HeartBeatInterval = 120f;
        }
        
        /// <summary>
        /// 发送心跳消息包。
        /// </summary>
        /// <returns>是否发送心跳消息包成功。</returns>
        public override bool SendHeartBeat(NetChannel channel,INetClient client)
        {
            //todo 发送心跳消息
            // Debug.Log("SendHeartBeat C#");
            // Com.Youzu.Got.Protocol.PingRequest pingRequest = new Com.Youzu.Got.Protocol.PingRequest();
            // pingRequest.ClientTimestamp = Yoozoo.Gameplay.Data.GlobalDataMgr.ServerTimeStamp;
            // channel.Send(GameFramework.Protocal.GetCSMap(typeof(Com.Youzu.Got.Protocol.PingRequest)), pingRequest, true);
            
            return true;
        }
       

    }
}